using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using UnityEngine;

public class BonemapsReader
{
    public BRTDriver.BoneMap[] bonemaps;

    public void Read(string filename)
    {
        List<BRTDriver.BoneMap> maplist = new List<BRTDriver.BoneMap>();
        using (StreamReader sr = new StreamReader(filename))
        {
            string line;
            while ((line = sr.ReadLine()) != null)
            {
                string[] words = line.Split(' ');
                if (words.Length != 2)
                    continue;
                BRTDriver.BoneMap tb = new BRTDriver.BoneMap();
                tb.lname = words[0];
                tb.rname = words[1];
                maplist.Add(tb);
            }
        }
        bonemaps = maplist.ToArray();
    }
}